home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / winexit / winexit.frm < prev    next >
Text File  |  1994-08-26  |  4KB  |  176 lines

  1. VERSION 2.00
  2. Begin Form frmWinExit 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Exit Windows"
  6.    ClientHeight    =   2145
  7.    ClientLeft      =   2115
  8.    ClientTop       =   1980
  9.    ClientWidth     =   2055
  10.    Height          =   2835
  11.    Icon            =   WINEXIT.FRX:0000
  12.    Left            =   2055
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   2145
  16.    ScaleWidth      =   2055
  17.    Top             =   1350
  18.    Width           =   2175
  19.    Begin CommandButton cmdCancel 
  20.       BackColor       =   &H00C0C0C0&
  21.       Cancel          =   -1  'True
  22.       Caption         =   "Cancel"
  23.       Height          =   315
  24.       Left            =   720
  25.       TabIndex        =   5
  26.       Top             =   1740
  27.       Width           =   1215
  28.    End
  29.    Begin OptionButton optChoice 
  30.       BackColor       =   &H00C0C0C0&
  31.       Caption         =   "Exit && Reboot"
  32.       Height          =   315
  33.       Index           =   2
  34.       Left            =   180
  35.       TabIndex        =   2
  36.       Top             =   960
  37.       Width           =   1575
  38.    End
  39.    Begin OptionButton optChoice 
  40.       BackColor       =   &H00C0C0C0&
  41.       Caption         =   "Restart Windows"
  42.       Height          =   315
  43.       Index           =   1
  44.       Left            =   180
  45.       TabIndex        =   1
  46.       Top             =   540
  47.       Width           =   1755
  48.    End
  49.    Begin OptionButton optChoice 
  50.       BackColor       =   &H00C0C0C0&
  51.       Caption         =   "Exit Windows"
  52.       Height          =   315
  53.       Index           =   0
  54.       Left            =   180
  55.       TabIndex        =   0
  56.       Top             =   120
  57.       Value           =   -1  'True
  58.       Width           =   1515
  59.    End
  60.    Begin PictureBox picOpenDoor 
  61.       AutoSize        =   -1  'True
  62.       BackColor       =   &H00C0C0C0&
  63.       BorderStyle     =   0  'None
  64.       Height          =   480
  65.       Left            =   120
  66.       Picture         =   WINEXIT.FRX:0302
  67.       ScaleHeight     =   480
  68.       ScaleWidth      =   480
  69.       TabIndex        =   4
  70.       TabStop         =   0   'False
  71.       Top             =   1500
  72.       Width           =   480
  73.    End
  74.    Begin CommandButton cmdOK 
  75.       BackColor       =   &H00C0C0C0&
  76.       Caption         =   "OK"
  77.       Default         =   -1  'True
  78.       Height          =   315
  79.       Left            =   720
  80.       TabIndex        =   3
  81.       Top             =   1380
  82.       Width           =   1215
  83.    End
  84.    Begin Menu mnuOptions 
  85.       Caption         =   "&Options"
  86.       Begin Menu mnuExit 
  87.          Caption         =   "E&xit"
  88.       End
  89.       Begin Menu mnuRestart 
  90.          Caption         =   "&Restart"
  91.       End
  92.       Begin Menu mnuReboot 
  93.          Caption         =   "Exit && Re&boot"
  94.       End
  95.    End
  96.    Begin Menu mnuAbout 
  97.       Caption         =   "&About"
  98.    End
  99. End
  100. Option Explicit
  101.  
  102. Sub cmdCancel_Click ()
  103.     End
  104. End Sub
  105.  
  106. Sub cmdOK_Click ()
  107.  
  108.     If optChoice(0).Value Then
  109.         Call WinExit(0)
  110.     ElseIf optChoice(1).Value Then
  111.         Call WinExit(1)
  112.     ElseIf optChoice(2).Value Then
  113.         Call WinExit(2)
  114.     End If
  115.  
  116.  
  117. End Sub
  118.  
  119. Sub Form_Load ()
  120.  
  121.     If UCase$(Command$) = "EXIT" Then
  122.         optChoice(0).Value = True
  123.         WinExit (0)
  124.     ElseIf UCase$(Command$) = "RESTART" Then
  125.         optChoice(1).Value = True
  126.         WinExit (1)
  127.     ElseIf UCase$(Command$) = "REBOOT" Then
  128.         optChoice(2).Value = True
  129.         WinExit (2)
  130.     End If
  131.     CentreForm Me
  132.  
  133. End Sub
  134.  
  135. Sub Form_Paint ()
  136.     MakeForm3D Me
  137. End Sub
  138.  
  139. Sub Form_Resize ()
  140.  
  141.     ' Don't let the user resize the form
  142.     ' i've made the form sizable as if you use menu
  143.     ' you can't have a fixed double border
  144.  
  145.     If windowstate <> 1 Then
  146.         width = 2130
  147.         height = 2835
  148.     End If
  149.  
  150. End Sub
  151.  
  152. Sub mnuAbout_Click ()
  153.     
  154.     frmAbout.Show 1
  155.  
  156. End Sub
  157.  
  158. Sub mnuExit_Click ()
  159.     
  160.     Call WinExit(0)
  161.  
  162. End Sub
  163.  
  164. Sub mnuReboot_Click ()
  165.     
  166.     Call WinExit(2)
  167.  
  168. End Sub
  169.  
  170. Sub mnuRestart_Click ()
  171.     
  172.     Call WinExit(1)
  173.  
  174. End Sub
  175.  
  176.